import request from "@/utils/request";
// 工具箱
export function addTool(data) {
  return request({
    url: "/toolbox",
    method: "post",
    data,
  });
}

export function editTool(data) {
  return request({
    url: "/toolbox",
    method: "put",
    data,
  });
}

export function getToolList(params) {
  return request({
    url: "/toolbox/page",
    method: "get",
    params,
  });
}

export function deleteTools(id) {
  return request({
    url: "/toolbox/" + id,
    method: "delete",
  });
}

export function editStatus(data) {
  return request({
    url: `/toolbox/enableStatus/${data.id}/${data.enableStatus}`,
    method: "put",
  });
}

//行业协议模版
export function addTemplate(data) {
  return request({
    url: "/industry/template",
    method: "post",
    data,
  });
}

export function editTemplate(data) {
  return request({
    url: "/industry/template",
    method: "put",
    data,
  });
}

export function getTemplateList(params) {
  return request({
    url: "/industry/template/page",
    method: "get",
    params,
  });
}

export function deleteTemplate(id) {
  return request({
    url: "/industry/template/" + id,
    method: "delete",
  });
}

export function getTemplate(id) {
  return request({
    url: "/industry/template/" + id,
    method: "get",
  });
}

export function updateStatus(id) {
  return request({
    url: `/industry/template/enableStatus/${id}`,
    method: "put",
  });
}

// 新增toolLoans

export function addToolLoans(data) {
  return request({
    url: "/toolLoans",
    method: "post",
    data,
  });
}

export function editToolLoans(data) {
  return request({
    url: "/toolLoans",
    method: "put",
    data,
  });
}

export function getToolLoansList(params) {
  return request({
    url: "/toolLoans/page",
    method: "get",
    params,
  });
}

export function deleteToolLoans(id) {
  return request({
    url: "/toolLoans/" + id,
    method: "delete",
  });
}

export function getToolLoans(id) {
  return request({
    url: "/toolLoans/" + id,
    method: "get",
  });
}

// 修改状态

export function updateToolLoansStatus(id) {
  return request({
    url: `/toolLoans/update/enableStatus/${id}`,
    method: "put",
  });
}

//征信网点查询
export function getCreditList(params) {
  return request({
    url: "/credit/outlets/page",
    method: "get",
    params,
  });
}

export function addCredit(data) {
  return request({
    url: "/credit/outlets",
    method: "post",
    data,
  });
}

export function editCredit(data) {
  return request({
    url: "/credit/outlets",
    method: "put",
    data,
  });
}

export function deleteCredit(id) {
  return request({
    url: "/credit/outlets/" + id,
    method: "delete",
  });
}

export function getCredit(id) {
  return request({
    url: "/credit/outlets/" + id,
    method: "get",
  });
}



export function getCreditStatus(id) {
  return request({
    url: `/credit/outlets/enableStatus/${id}`,
    method: "put",
  });
}

//获取行口通讯录
export function getAddressList(params) {
  return request({
    url: "/toolLoans/getBankQuestionsPage",
    method: "get",
    params,
  });
}

//获取错误码

export function getErrorCodeList(params) {
  return request({
    url: "/toolLoans/getErrorCodePage",
    method: "get",
    params,
  });
}

// 新增银行通讯录
export function bankBook(data) {
  return request({
    url: "/bankBook",
    method: "post",
    data,
  });
}
// 修改银行通讯录
export function edbankBook(data) {
  return request({
    url: "/bankBook",
    method: "put",
    data,
  });
}
// 根据银行通讯录id获取详细信息
export function bankBookid(id) {
  return request({
    url: "/bankBook/" + id,
    method: "get",
  });
}

//获取行口通讯录
export function bankBookpage(params) {
  return request({
    url: "/bankBook/page",
    method: "get",
    params,
  });
}
// 修改启用状态
export function bankBookenableStatus(id) {
  return request({
    url: `/bankBook/update/enableStatus/${id}`,
    method: "put",
  });
}
// 根据主键id删除银行通讯录
export function bankBookLoans(id) {
  return request({
    url: "/bankBook/" + id,
    method: "delete",
  });
}
